#pragma once
#include <nice2d/textoption.h>
#include <nice2d/anchor.h>
#include <nice2d/spritedecorator.h>

class SpriteAttributeDecorator : public SpriteDecorator,public Anchor
{
    DECLARE_OBJECT(SpriteAttributeDecorator);
public:
    SpriteAttributeDecorator() = delete;
    SpriteAttributeDecorator(const TextOption &option);
    ~SpriteAttributeDecorator();
public:
    void setAttibutes(const std::vector<int32_t> &attributes, const std::string &separator = "-");
    void setTextColor(const sf::Color& color);
    sf::Color getTextColor()const;
public:
    void draw(sf::RenderTarget &target, sf::RenderStates states)const override;
    void update() override;
    void updateAnchor()override;

    PTree serialize()override;
    void deserialize(const PTree &node)override;
private:
    std::unique_ptr<class SpriteAttributeDecoratorData> data;
};
